Protobuf 模块
GrowingIO SDK protobuf 数据模块使用 Google Protobuf 格式保存和上传事件数据。
caution
使用 Protobuf 格式保存和上传事件数据,集成即生效;与其他格式,如json 互不兼容,迁移将导致APP本地数据库内未上传的事件数据丢失,后续产生的新数据则不受影响。
SDK说明
| 关键词 | 是否集成 | 输入数据类 | 输出数据类 | 最低SDK版本 | 
|---|---|---|---|---|
| protobuf | 需要手动集成 | EventFormatData | EventByteArray | >=3.3.3 | 
依赖方式
- 依赖
 - BoM
 
dependencies {
    implementation 'com.growingio.android:protobuf:3.5.4'
}
dependencies {
  // Import the BoM for the GrowingIO platform
  implementation platform('com.growingio.android:autotracker-bom:3.5.4')
  implementation 'com.growingio.android:protobuf'
}
使用方式
- 无埋点
 - 埋点
 
GrowingAutotracker.startWithConfiguration(this,
                new CdpAutotrackConfiguration("accountId", "urlScheme")
                //...
                .addPreloadComponent(new ProtobufLibraryModule()));
GrowingTracker.startWithConfiguration(this,
                new CdpTrackConfiguration("accountId", "urlScheme")
                //...
                .addPreloadComponent(new ProtobufLibraryModule()));
示例
数据结果如下图所示:
